<template>
  <div class="p-2">
    <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
      <div v-show="showSearch" class="mb-[10px]">
        <el-card shadow="hover">
          <el-form ref="queryFormRef" :model="queryParams" :inline="true">
            <el-form-item label="订单号" prop="orderNo">
              <el-input v-model="queryParams.orderNo" placeholder="请输入运单号" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="入库单号" prop="inboundNo">
              <el-input v-model="queryParams.inboundNo" placeholder="请输入第三方入库单号" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="物流单号" prop="logisticsNo">
              <el-input v-model="queryParams.logisticsNo" placeholder="请输入物流运单号" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="集货方式" prop="storeType">
              <el-select v-model="queryParams.storeType" placeholder="请选择集货方式" clearable >
                <el-option v-for="dict in tms_store_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
              </el-select>
            </el-form-item>
            <el-form-item label="国家" prop="countryType">
              <el-select v-model="queryParams.countryType" placeholder="请选择目的地国家" clearable >
                <el-option v-for="dict in tms_country_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
              </el-select>
            </el-form-item>
            <el-form-item label="运输方式" prop="transportType">
              <el-select v-model="queryParams.transportType" placeholder="请选择运输方式" clearable >
                <el-option v-for="dict in tms_transport_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
              </el-select>
            </el-form-item>
            <el-form-item label="送仓方式" prop="deliveryMethod">
              <el-select v-model="queryParams.deliveryMethod" placeholder="请选择海外仓送仓方式" clearable >
                <el-option v-for="dict in tms_delivery_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
              </el-select>
            </el-form-item>
            <el-form-item label="货物类型 " prop="omsGoodsType">
              <el-select v-model="queryParams.omsGoodsType" placeholder="请选择货物类型 " clearable >
                <el-option v-for="dict in tms_goods_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
              </el-select>
            </el-form-item>
            <el-form-item label="货物类型" prop="goodsType">
              <el-select v-model="queryParams.goodsType" placeholder="请选择货物类型" clearable >
                <el-option v-for="dict in tms_goods_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
              </el-select>
            </el-form-item>
            <el-form-item label="单独报关" prop="customsDeclaration">
              <el-select v-model="queryParams.customsDeclaration" placeholder="请选择单独报关" clearable >
                <el-option v-for="dict in tms_customs_declaration_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
              </el-select>
            </el-form-item>
            <el-form-item label="交货方式" prop="dealMethod">
              <el-select v-model="queryParams.dealMethod" placeholder="请选择交货方式" clearable >
                <el-option v-for="dict in tms_deal_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
              </el-select>
            </el-form-item>
            <el-form-item label="运单状态" prop="orderType">
              <el-select v-model="queryParams.orderType" placeholder="请选择运单状态" clearable >
                <el-option v-for="dict in order_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
              </el-select>
            </el-form-item>
            <el-form-item label="测量时间" prop="measureTime">
              <el-date-picker clearable
                v-model="queryParams.measureTime"
                type="date"
                value-format="YYYY-MM-DD"
                placeholder="请选择测量时间"
              />
            </el-form-item>
            <el-form-item label="装柜时间" prop="packingTime">
              <el-date-picker clearable
                v-model="queryParams.packingTime"
                type="date"
                value-format="YYYY-MM-DD"
                placeholder="请选择装柜时间"
              />
            </el-form-item>
            <el-form-item label="发运时间" prop="shippedTime">
              <el-date-picker clearable
                v-model="queryParams.shippedTime"
                type="date"
                value-format="YYYY-MM-DD"
                placeholder="请选择发运时间"
              />
            </el-form-item>
            <el-form-item label="清关时间" prop="arrivedTime">
              <el-date-picker clearable
                v-model="queryParams.arrivedTime"
                type="date"
                value-format="YYYY-MM-DD"
                placeholder="请选择清关时间"
              />
            </el-form-item>
            <el-form-item label="派送时间" prop="deliveryTime">
              <el-date-picker clearable
                v-model="queryParams.deliveryTime"
                type="date"
                value-format="YYYY-MM-DD"
                placeholder="请选择派送时间"
              />
            </el-form-item>
            <el-form-item label="完成时间" prop="signedTime">
              <el-date-picker clearable
                v-model="queryParams.signedTime"
                type="date"
                value-format="YYYY-MM-DD"
                placeholder="请选择完成时间"
              />
            </el-form-item>
            <el-form-item label="到港时间" prop="predictArrivedTime">
              <el-date-picker clearable
                v-model="queryParams.predictArrivedTime"
                type="date"
                value-format="YYYY-MM-DD"
                placeholder="请选择预计到港时间"
              />
            </el-form-item>
            <el-form-item label="入仓时间" prop="inTransitTime">
              <el-date-picker clearable
                v-model="queryParams.inTransitTime"
                type="date"
                value-format="YYYY-MM-DD"
                placeholder="请选择待入仓时间"
              />
            </el-form-item>
            <el-form-item>
              <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
              <el-button icon="Refresh" @click="resetQuery">重置</el-button>
            </el-form-item>
          </el-form>
        </el-card>
      </div>
    </transition>

    <el-card shadow="never">
      <template #header>
        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['tms:order:add']">新增</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['tms:order:edit']">修改</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['tms:order:remove']">删除</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['tms:order:export']">导出</el-button>
          </el-col>
          <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
        </el-row>
      </template>

      <el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column label="用户名称" align="center" prop="userId" />
        <el-table-column label="运单号" align="center" prop="orderNo" />
        <el-table-column label="第三方入库单号" align="center" prop="inboundNo" />
        <el-table-column label="物流运单号" align="center" prop="logisticsNo" />
        <el-table-column label="集货方式" align="center" prop="storeType">
          <template #default="scope">
            <dict-tag :options="tms_store_type" :value="scope.row.storeType"/>
          </template>
        </el-table-column>
        <el-table-column label="目的地国家" align="center" prop="countryType">
          <template #default="scope">
            <dict-tag :options="tms_country_type" :value="scope.row.countryType"/>
          </template>
        </el-table-column>
        <el-table-column label="运输方式" align="center" prop="transportType">
          <template #default="scope">
            <dict-tag :options="tms_transport_type" :value="scope.row.transportType"/>
          </template>
        </el-table-column>
        <el-table-column label="海外仓送仓方式" align="center" prop="deliveryMethod">
          <template #default="scope">
            <dict-tag :options="tms_delivery_type" :value="scope.row.deliveryMethod"/>
          </template>
        </el-table-column>
        <el-table-column label="货物类型 " align="center" prop="omsGoodsType">
          <template #default="scope">
            <dict-tag :options="tms_goods_type" :value="scope.row.omsGoodsType"/>
          </template>
        </el-table-column>
        <el-table-column label="货物类型" align="center" prop="goodsType">
          <template #default="scope">
            <dict-tag :options="tms_goods_type" :value="scope.row.goodsType"/>
          </template>
        </el-table-column>
        <el-table-column label="单独报关" align="center" prop="customsDeclaration">
          <template #default="scope">
            <dict-tag :options="tms_customs_declaration_type" :value="scope.row.customsDeclaration"/>
          </template>
        </el-table-column>
        <el-table-column label="交货方式" align="center" prop="dealMethod">
          <template #default="scope">
            <dict-tag :options="tms_deal_type" :value="scope.row.dealMethod"/>
          </template>
        </el-table-column>
        <el-table-column label="运单状态" align="center" prop="orderType">
          <template #default="scope">
            <dict-tag :options="order_type" :value="scope.row.orderType"/>
          </template>
        </el-table-column>
        <el-table-column label="预报方数" align="center" prop="preVolume" />
        <el-table-column label="订单备注" align="center" prop="remake" />
        <el-table-column label="仓库id" align="center" prop="warehouseId" />
        <el-table-column label="收货地址id" align="center" prop="addressId" />
        <el-table-column label="箱唛号" align="center" prop="boxLabel" />
        <el-table-column label="签收单" align="center" prop="signatureFormUrl" />
        <el-table-column label="是否拆箱" align="center" prop="unBoxingFlag" >
            <template #default="scope">
              <dict-tag :options="tms_un_boxing_flag" :value="scope.row.unBoxingFlag"/>
            </template>
        </el-table-column>
        <el-table-column label="测量时间" align="center" prop="measureTime" width="180">
          <template #default="scope">
            <span>{{ parseTime(scope.row.measureTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="装柜时间" align="center" prop="packingTime" width="180">
          <template #default="scope">
            <span>{{ parseTime(scope.row.packingTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="发运时间" align="center" prop="shippedTime" width="180">
          <template #default="scope">
            <span>{{ parseTime(scope.row.shippedTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="清关时间" align="center" prop="arrivedTime" width="180">
          <template #default="scope">
            <span>{{ parseTime(scope.row.arrivedTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="派送时间" align="center" prop="deliveryTime" width="180">
          <template #default="scope">
            <span>{{ parseTime(scope.row.deliveryTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="完成时间" align="center" prop="signedTime" width="180">
          <template #default="scope">
            <span>{{ parseTime(scope.row.signedTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="预计到港时间" align="center" prop="predictArrivedTime" width="180">
          <template #default="scope">
            <span>{{ parseTime(scope.row.predictArrivedTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="待入仓时间" align="center" prop="inTransitTime" width="180">
          <template #default="scope">
            <span>{{ parseTime(scope.row.inTransitTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
          <template #default="scope">
            <el-tooltip content="修改" placement="top">
              <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['tms:order:edit']"></el-button>
            </el-tooltip>
            <el-tooltip content="删除" placement="top">
              <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['tms:order:remove']"></el-button>
            </el-tooltip>
          </template>
        </el-table-column>
      </el-table>

      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
    </el-card>
    <!-- 添加或修改订单对话框 -->
    <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
      <el-form ref="orderFormRef" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="订单号" prop="orderNo">
          <el-input v-model="form.orderNo" placeholder="请输入订单号" />
        </el-form-item>
        <el-form-item label="第三方入库单号" prop="inboundNo">
          <el-input v-model="form.inboundNo" placeholder="请输入第三方入库单号" />
        </el-form-item>
        <el-form-item label="物流运单号" prop="logisticsNo">
          <el-input v-model="form.logisticsNo" placeholder="请输入物流运单号" />
        </el-form-item>
        <el-form-item label="集货方式" prop="storeType">
          <el-select v-model="form.storeType" placeholder="请选择集货方式">
            <el-option
                v-for="dict in tms_store_type"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="目的地国家" prop="countryType">
          <el-select v-model="form.countryType" placeholder="请选择目的地国家">
            <el-option
                v-for="dict in tms_country_type"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="运输方式" prop="transportType">
          <el-select v-model="form.transportType" placeholder="请选择运输方式">
            <el-option
                v-for="dict in tms_transport_type"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="送仓方式" prop="deliveryMethod">
          <el-select v-model="form.deliveryMethod" placeholder="请选择海外仓送仓方式">
            <el-option
                v-for="dict in tms_delivery_type"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="货物类型 " prop="omsGoodsType">
          <el-select v-model="form.omsGoodsType" placeholder="请选择货物类型 ">
            <el-option
                v-for="dict in tms_goods_type"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="单独报关" prop="customsDeclaration">
          <el-select v-model="form.customsDeclaration" placeholder="请选择单独报关">
            <el-option
                v-for="dict in tms_customs_declaration_type"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="交货方式" prop="dealMethod">
          <el-select v-model="form.dealMethod" placeholder="请选择交货方式">
            <el-option
                v-for="dict in tms_deal_type"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="预报方数" prop="preVolume">
          <el-input v-model="form.preVolume" placeholder="请输入预报方数" />
        </el-form-item>
        <el-form-item label="订单备注" prop="remake">
          <el-input v-model="form.remake" placeholder="请输入订单备注" />
        </el-form-item>
        <el-form-item label="仓库id" prop="warehouseId">
          <el-input v-model="form.warehouseId" placeholder="请输入仓库id" />
        </el-form-item>
        <el-form-item label="收货地址id" prop="addressId">
          <el-input v-model="form.addressId" placeholder="请输入收货地址id" />
        </el-form-item>

      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="cancel">取 消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script setup name="Order" lang="ts">
import { listOrder, getOrder, delOrder, addOrder, updateOrder } from '@/api/tms/order';
import { OrderVO, OrderQuery, OrderForm } from '@/api/tms/order/types';

const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { tms_transport_type, tms_goods_type, tms_customs_declaration_type, tms_deal_type, order_type,tms_un_boxing_flag, tms_country_type, tms_store_type, tms_delivery_type } = toRefs<any>(proxy?.useDict('tms_transport_type', 'tms_goods_type', 'tms_customs_declaration_type', 'tms_deal_type', 'order_type',  'tms_un_boxing_flag', 'tms_country_type', 'tms_store_type', 'tms_delivery_type'));

const orderList = ref<OrderVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);

const queryFormRef = ref<ElFormInstance>();
const orderFormRef = ref<ElFormInstance>();

const dialog = reactive<DialogOption>({
  visible: false,
  title: ''
});

const initFormData: OrderForm = {
  id: undefined,
  userId: undefined,
  orderNo: undefined,
  inboundNo: undefined,
  logisticsNo: undefined,
  storeType: undefined,
  countryType: undefined,
  transportType: undefined,
  deliveryMethod: undefined,
  omsGoodsType: undefined,
  goodsType: undefined,
  customsDeclaration: undefined,
  dealMethod: undefined,
  orderType: undefined,
  preVolume: undefined,
  remake: undefined,
  warehouseId: undefined,
  addressId: undefined,
  boxLabel: undefined,
  boxLabelUrl: undefined,
  signatureFormUrl: undefined,
  unBoxingFlag: undefined,
  measureTime: undefined,
  packingTime: undefined,
  shippedTime: undefined,
  arrivedTime: undefined,
  deliveryTime: undefined,
  signedTime: undefined,
  predictArrivedTime: undefined,
  inTransitTime: undefined
}
const data = reactive<PageData<OrderForm, OrderQuery>>({
  form: {...initFormData},
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    userId: undefined,
    orderNo: undefined,
    inboundNo: undefined,
    logisticsNo: undefined,
    storeType: undefined,
    countryType: undefined,
    transportType: undefined,
    deliveryMethod: undefined,
    omsGoodsType: undefined,
    goodsType: undefined,
    customsDeclaration: undefined,
    dealMethod: undefined,
    orderType: undefined,
    preVolume: undefined,
    remake: undefined,
    warehouseId: undefined,
    addressId: undefined,
    boxLabel: undefined,
    boxLabelUrl: undefined,
    signatureFormUrl: undefined,
    unBoxingFlag: undefined,
    measureTime: undefined,
    packingTime: undefined,
    shippedTime: undefined,
    arrivedTime: undefined,
    deliveryTime: undefined,
    signedTime: undefined,
    predictArrivedTime: undefined,
    inTransitTime: undefined,
    params: {
    }
  },
  rules: {
    id: [
      { required: true, message: "逻辑主键不能为空", trigger: "blur" }
    ],
    userId: [
      { required: true, message: "用户ID不能为空", trigger: "blur" }
    ],
    orderNo: [
      { required: true, message: "运单号不能为空", trigger: "blur" }
    ],
    inboundNo: [
      { required: true, message: "第三方入库单号不能为空", trigger: "blur" }
    ],
    logisticsNo: [
      { required: true, message: "物流运单号不能为空", trigger: "blur" }
    ],
    storeType: [
      { required: true, message: "集货方式不能为空", trigger: "change" }
    ],
    countryType: [
      { required: true, message: "目的地国家不能为空", trigger: "change" }
    ],
    transportType: [
      { required: true, message: "运输方式不能为空", trigger: "change" }
    ],
    deliveryMethod: [
      { required: true, message: "海外仓送仓方式不能为空", trigger: "change" }
    ],
    omsGoodsType: [
      { required: true, message: "货物类型 不能为空", trigger: "change" }
    ],
    goodsType: [
      { required: true, message: "货物类型不能为空", trigger: "change" }
    ],
    customsDeclaration: [
      { required: true, message: "单独报关不能为空", trigger: "change" }
    ],
    dealMethod: [
      { required: true, message: "交货方式不能为空", trigger: "change" }
    ],
    orderType: [
      { required: true, message: "运单状态不能为空", trigger: "change" }
    ],
    preVolume: [
      { required: true, message: "预报方数不能为空", trigger: "blur" }
    ],
    remake: [
      { required: true, message: "订单备注不能为空", trigger: "blur" }
    ],
    warehouseId: [
      { required: true, message: "仓库id不能为空", trigger: "blur" }
    ],
    addressId: [
      { required: true, message: "收货地址id不能为空", trigger: "blur" }
    ],
    boxLabel: [
      { required: true, message: "箱唛不能为空", trigger: "blur" }
    ],
    boxLabelUrl: [
      { required: true, message: "生成箱唛详情的url不能为空", trigger: "blur" }
    ],
    signatureFormUrl: [
      { required: true, message: "上传的签收单url不能为空", trigger: "blur" }
    ],
    unBoxingFlag: [
      { required: true, message: "拆箱标记不能为空", trigger: "blur" }
    ],
    measureTime: [
      { required: true, message: "测量时间不能为空", trigger: "blur" }
    ],
    packingTime: [
      { required: true, message: "装柜时间不能为空", trigger: "blur" }
    ],
    shippedTime: [
      { required: true, message: "发运时间不能为空", trigger: "blur" }
    ],
    arrivedTime: [
      { required: true, message: "清关时间不能为空", trigger: "blur" }
    ],
    deliveryTime: [
      { required: true, message: "派送时间不能为空", trigger: "blur" }
    ],
    signedTime: [
      { required: true, message: "完成时间不能为空", trigger: "blur" }
    ],
    predictArrivedTime: [
      { required: true, message: "预计到港时间不能为空", trigger: "blur" }
    ],
    inTransitTime: [
      { required: true, message: "待入仓时间不能为空", trigger: "blur" }
    ]
  }
});

const { queryParams, form, rules } = toRefs(data);

/** 查询订单列表 */
const getList = async () => {
  loading.value = true;
  const res = await listOrder(queryParams.value);
  orderList.value = res.rows;
  total.value = res.total;
  loading.value = false;
}

/** 取消按钮 */
const cancel = () => {
  reset();
  dialog.visible = false;
}

/** 表单重置 */
const reset = () => {
  form.value = {...initFormData};
  orderFormRef.value?.resetFields();
}

/** 搜索按钮操作 */
const handleQuery = () => {
  queryParams.value.pageNum = 1;
  getList();
}

/** 重置按钮操作 */
const resetQuery = () => {
  queryFormRef.value?.resetFields();
  handleQuery();
}

/** 多选框选中数据 */
const handleSelectionChange = (selection: OrderVO[]) => {
  ids.value = selection.map(item => item.id);
  single.value = selection.length != 1;
  multiple.value = !selection.length;
}

/** 新增按钮操作 */
const handleAdd = () => {
  reset();
  dialog.visible = true;
  dialog.title = "添加订单";
}

/** 修改按钮操作 */
const handleUpdate = async (row?: OrderVO) => {
  reset();
  const _id = row?.id || ids.value[0]
  const res = await getOrder(_id);
  Object.assign(form.value, res.data);
  dialog.visible = true;
  dialog.title = "修改订单";
}

/** 提交按钮 */
const submitForm = () => {
  orderFormRef.value?.validate(async (valid: boolean) => {
    if (valid) {
      buttonLoading.value = true;
      if (form.value.id) {
        await updateOrder(form.value).finally(() =>  buttonLoading.value = false);
      } else {
        await addOrder(form.value).finally(() =>  buttonLoading.value = false);
      }
      proxy?.$modal.msgSuccess("操作成功");
      dialog.visible = false;
      await getList();
    }
  });
}

/** 删除按钮操作 */
const handleDelete = async (row?: OrderVO) => {
  const _ids = row?.id || ids.value;
  await proxy?.$modal.confirm('是否确认删除订单编号为"' + _ids + '"的数据项？').finally(() => loading.value = false);
  await delOrder(_ids);
  proxy?.$modal.msgSuccess("删除成功");
  await getList();
}

/** 导出按钮操作 */
const handleExport = () => {
  proxy?.download('tms/order/export', {
    ...queryParams.value
  }, `order_${new Date().getTime()}.xlsx`)
}

onMounted(() => {
  getList();
});
</script>
